﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using AssetManageSystem.Model.AssetManage;
using AssetManageSystem.Model.Enum;


namespace AssetManageSystem.ViewModel.AssetManage.AssetTypeVMs
{
    public partial class AssetTypeTemplateVM : BaseTemplateVM
    {
        [Display(Name = "类型名称")]
        public ExcelPropety TypeName_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.TypeName);
        [Display(Name = "类型代码")]
        public ExcelPropety TypeCode_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.TypeCode);
        [Display(Name = "排序")]
        public ExcelPropety DisplayOrder_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.DisplayOrder);
        [Display(Name = "备注")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.Remark);
        [Display(Name = "状态")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.Status);
        [Display(Name = "_Admin.Parent")]
        public ExcelPropety Parent_Excel = ExcelPropety.CreateProperty<AssetType>(x => x.ParentId);

	    protected override void InitVM()
        {
            Parent_Excel.DataType = ColumnDataType.ComboBox;
            Parent_Excel.ListItems = DC.Set<AssetType>().GetSelectListItems(Wtm, y => y.TypeName);
        }

    }

    public class AssetTypeImportVM : BaseImportVM<AssetTypeTemplateVM, AssetType>
    {

    }

}
